package ;

import nme.display.BitmapData;
import org.flixel.addons.FlxSpriteAniRot;
import org.flixel.addons.OgmoLevelLoader;
import org.flixel.FlxGroup;
import org.flixel.FlxSprite;
import nme.Assets;
import org.flixel.FlxG;

/**
 * ...
 * @author ...
 */
class UI extends FlxGroup
{
	private var background : FlxSprite;
	
	private var fire 		: FlxSprite;
	private var ice 		: FlxSprite;
	private var earth 		: FlxSprite;
	private var sliderFire 	: FlxSprite;
	private var sliderIce 	: FlxSprite;
	private var sliderEarth	: FlxSprite;
	
	public var ntClassic	: Notes;
	public var currentNotes : FlxGroup;
	public var currentUI : FlxGroup;
	
	public function new() 
	{
		super();
		
		callBg();
		
		fire 		= new FlxSprite(19, 423, ("assets/gfx/fire_icon.png"));
		//fire.loadGraphic(("assets/gfx/fire_icon.png"));
		ice 		= new FlxSprite(19, 502, Assets.getBitmapData("assets/gfx/ice_icon.png"));
		earth 		= new FlxSprite(19, 552, Assets.getBitmapData("assets/gfx/earth_icon.png"));
		sliderFire	 = new FlxSprite(61, 453, Assets.getBitmapData("assets/gfx/slider.png"));
		sliderIce	 = new FlxSprite(61, 502, Assets.getBitmapData("assets/gfx/slider.png"));
		sliderEarth	 = new FlxSprite(61, 552, Assets.getBitmapData("assets/gfx/slider.png"));
		
		add(fire);
		
		
		trace (fire);
		trace (this);
		
		/*
		fire 	= new FlxSprite(200, 200, Assets.getBitmapData("assets/gfx/ui_fire.png")); fire.scale.x = 0.3; fire.scale.y = 0.3;
		ice 	= new FlxSprite(200, 200, Assets.getBitmapData("assets/gfx/ui_ice.png"));
		earth	= new FlxSprite(200, 200, Assets.getBitmapData("assets/gfx/ui_earth.png"));
		sliderFire	 = new FlxSprite(200, 200, Assets.getBitmapData("assets/gfx/ui_slider.png"));
		sliderIce 	 = new FlxSprite(200, 200, Assets.getBitmapData("assets/gfx/ui_slider.png"));
		sliderEarth  = new FlxSprite(200, 200, Assets.getBitmapData("assets/gfx/ui_slider.png"));
		*/
		currentNotes = new FlxGroup();
	}
	
	override public function update()
	{
		
		// User inputs
		if (FlxG.keys.justPressed("A"))
		{
			trace ("AAAAAAA");
		}
		if (FlxG.keys.justPressed("Z"))
		{
			trace ("ZZZZZZZ");
		}
		if (FlxG.keys.justPressed("E"))
		{
			trace ("EEEEEEE");
		}
		
		// Debug launches new spells
		
	}
	
	public function callBg( /* level : LvlLoader */) : FlxSprite
	{
		var bg = new FlxSprite(0, 0, Assets.getBitmapData("assets/gfx/castle-01.png"));
		return (bg);
	}
	
}